<template>
  <div class="cmp cmp-progress">
    <div class="left">
        <div class="slider" :style="sliderStyles"></div>
    </div>
    <div class="right">{{percent}}%</div>
  </div>
</template>
<script>
export default {
  name: 'cmp-progress',
  props: {
    percent: {
      type: [Number, String],
      default: 0
    }
  },
  data () {
    return {}
  },
  computed:{
    sliderStyles () {
      return {
        width: `${this.percent || 0}%`
      }
    }
  },
}
</script>
<style lang="less" scoped>
@import "~@/assets/css/_mixins.less";
@import "~@/assets/css/_color.less";
.cmp-progress {
  display: flex;
  height:30px;
  line-height: 30px;
  .left {
    flex-grow: 1;
    width: 0;
    height: 6px;
    margin-top:12px;
    border-radius: 3px;
    background: #f5f5f5;
    overflow: hidden;
    .slider {
      height:6px;
      background: #00dfcd;
    }
  }
  .right {
    width: 60px;
    font-size: 14px;
    color:#00dfcd;
  }
}
</style>
